package cn.diancan.model.types;

public enum UserOrderStatusType {
    
    /**
     * 待确认  0(待接单)
     */
    NOTAKE(0,"待确认","待接单"),
    
    /**
     * 同意1(待确认)
     */
    NOCONFIRM(1,"同意","待完成"),
    
    /**
     * 完成2 (完成)
     */
    FINISH(2,"完成","完成"),
    
    /**
     * 拒绝   -1
     */
    REFUSE(-1,"拒绝","拒绝"),
    
    /**
     * 关闭 -2
     */
    CLOSE(-2,"关闭","关闭"),
    
    /**
     * 未付平台服务费 -50(待付款)
     */
    NOPAY(-50,"未付平台服务费","待付款");
    
    //
    //1待付款   2已付款(待发货) 3.待确认收货    4.成功
    // 				  5.退款
    
    public Integer code;
    public String desc;
    public String desc2;
    
    
    private UserOrderStatusType(int code, String desc,String desc2) {
	this.code = code;
	this.desc = desc;
	this.desc2 =desc2;
    }
    
    
    /**
     * 检查值是否存在
     * @param code
     * @return
     */
    public static boolean checkExists(Integer code){
	if(null==code){
	    return false;
	}
	UserOrderStatusType enums[] =UserOrderStatusType.values();
	for (int i = 0; i < enums.length; i++) {
	    UserOrderStatusType singleEnum=  enums[i];
	    if(singleEnum.getCode().equals(code)){
		return true;
	    }
	}
	return false;
    }


    public Integer getCode() {
        return code;
    }


    public String getDesc() {
        return desc;
    }


    public String getDesc2() {
        return desc2;
    }
    
 
     
    
    
    

}
